<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>




<!--加入websocket的消息提醒 （ 首页显示的未读的消息）-->
<script>
    var API_URL = "http://www.chat.com/index.php/api/chat/";
    var fromid ={$fromid}; //获取来自哪里的信息
    var no_read; // 获取未读消息
    //聊天列表的信息
    ws = new WebSocket("ws://127.0.0.1:8282");

    ws.onmessage=function(e){
        var message = eval("("+e.data+")");

        switch (message.type) {
            case "init":
                var  bild = '{"type":"bind","fromid":"'+fromid+'"}';
                ws.send(bild);
                getnoread(); //获取未读消息
                return;
            case "text":

                return;
            case "say_img":

                return;
        }

    }

    function getnoread() {


    }
</script>
</body>
</html>